/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FileInformation.providers;

/**
 *
 * @author Nobody
 */
public enum DataSeparatorEnum {

    SEMICOLON, COMA, TAB, SPACE, WHITE_SPACES;

    public static DataSeparatorEnum convert(String item) {
        if (";".equals(item)) {
            return SEMICOLON;
        } else if (",".equals(item)) {
            return COMA;
        } else if ("\t".equals(item)) {
            return TAB;
        } else if (" ".equals(item)) {
            return SPACE;
        } else if ("\\s+".equals(item)) {
            return WHITE_SPACES;
        }
        return null;
    }

    @Override
    public String toString() {
        switch (this) {
            case SEMICOLON:
                return ";";
            case COMA:
                return ",";
            case TAB:
                return "\\t";
            case SPACE:
                return "' '";
            case WHITE_SPACES:
                return "\\s+";
            default:
                return null;

        }
    }
}
